<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class feedbacks extends CI_Controller {

	/**
	 * Index Page for this controller.
	 *
	 * Maps to the following URL
	 * 		http://example.com/admin/feedback
	 *	- or -  
	 * 		http://example.com/admin/feedback/index
	 *	- or -
	 * Since this controller is set as the default controller in 
	 * config/routes.php, it's displayed at http://example.com/
	 *
	 * So any other public methods not prefixed with an underscore will
	 * map to /index.php/Gallery/<method_name>
	 * @see http://codeigniter.com/user_guide/general/urls.html
	 */
	public function index()
	{
		$this->feedbacks();
	}
	
	public function feedbacks()
	{
		$this->data['current_page'] = "feedbacks";
		$this->data['messages'] = $this->tdatabase->get_entry('feedback');
		$this->parser->parse("admin/header.tpl", $this->data);
		$this->parser->parse("admin/feedbacks.tpl", $this->data);
		$this->parser->parse("admin/footer.tpl", $this->data);	
	}
	
	public function delete($id)
	{
		$this->tdatabase->remove_entry('id', $id, "feedback");
		$this->feedbacks();
	}

	public function __construct()
	{
		parent::__construct();
		$this->load->library('ion_auth');
		$this->load->library(array('encrypt', 'form_validation', 'session'));
		$this->load->model('tdatabase_model', 'tdatabase');
		// LOAD HELPERS
		$this->load->helper(array('form'));
		if (!$this->ion_auth->logged_in()) {
			redirect(site_url('auth'));
		}
	}
}

/* End of file Gallery.php */
/* Location: ./application/controllers/Gallery.php */
